package com.omt.tarjimdinek.domain.user.Service;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.apache.log4j.Logger;

import com.omt.tarjimdinek.domain.user.entity.Habilitation;
import com.omt.tarjimdinek.support.GenericDao;
import com.omt.tarjimdinek.support.RepositoryImpl;

import com.omt.tarjimdinek.domain.user.dao.HabilitationDao;
/**
 * Authorization manager implements
 * @author chabane
 *
 */
@Named("habilitationRepository")
@Singleton
public class HabilitationRepositoryImpl extends RepositoryImpl<Habilitation, String> implements HabilitationRepository {

	private HabilitationDao habilitationDao; 
	
	@SuppressWarnings("unused")
	private static final Logger log = Logger.getLogger(HabilitationRepositoryImpl.class);

	@Inject
	public void setHabilitationDao(HabilitationDao habilitationDao) {
	   this.habilitationDao = habilitationDao;
	}

	/**
	  * Dao getter used by the {@link RepositoryImpl}.
	  */
	@Override
	public GenericDao<Habilitation, String> getDao() {
	   return habilitationDao;
	}     

	/**
     * {@inheritDoc}
     */
    @Override
    public Habilitation getNew() {
        return new Habilitation();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Habilitation getNewWithDefaults() {
    	Habilitation result = getNew();
        result.initDefaultValues();
        return result;
    }
}
